import { post } from '@/request/http'
import store from '@/store'
// import { toString } from '@/utils/utils'
// import store from '@/store'

// 订单关闭  接口 sugarOrderInfo
export const sugarOrderInfo = ({ attCode, attStatus, cmtContractNo, attCreatetimeStart, attCreatetimeEnd, PageIndex, PageSize, source }) => {
  return post('/FTKJWLHYPT/transoprt/sugarOrderInfo', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          fltUuid: store.state.user.FLT_UUID_DX_H,
          attDptId: store.state.user.DPTID_DX_H,
          attCode,
          cmtContractNo,
          attStatus,
          attCreatetimeStart,
          attCreatetimeEnd,
          source
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT: PageIndex
      },
      PageSize: {
        FTKJWLHYPT: PageSize
      }
    }
  })
}
//申请关闭
export const shutOrderSer = ({ uuid, attCode }) => {
  return post('/FTKJWLHYPT/transoprt/shutOrder', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          attCode,
          fltUuid: store.state.user.FLT_UUID_DX_H,
          attLstmodifier: store.state.user.USR_CODE_DX_H,
          attApplyStatus: '1'
        }
      }
    }
  })
}
//审核关闭申请
export const auditshutOrderSer = ({ uuid, attCode }) => {
  return post('/FTKJWLHYPT/transoprt/shutOrder', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          attCode,
          fltUuid: store.state.user.FLT_UUID_DX_H,
          attLstmodifier: store.state.user.USR_CODE_DX_H,
          attApplyStatus: '2'
        }
      }
    }
  })
}
//订单关闭 表格数据
export const orderCloseList = data =>
  post('/FTKJWLHYPT/orderManagement/list', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          odcCode: data.odcCode, //订单号
          odcConsigner: data.odcConsigner, //委托人
          ordCreatetimeStart: data.ordCreatetimeStart, //下单开始时间
          ordCreatetimeEnd: data.ordCreatetimeEnd, //下单结束时间
          odcStatus: '关闭'
        }
      },
      Orderbys: {},
      PageIndexs: {
        FTKJWLHYPT: data.PageIndexs
      },
      PageSizes: {
        FTKJWLHYPT: data.PageSizes
      }
    }
  })
//订单关闭 表格数据
export const orderCloseQuery = data =>
  post('/FTKJWLHYPT/orderManagement/orderColse', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          ordId: data.ordId
        }
      }
    }
  })
